<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/4/9
  Time: 16:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="bp" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>蓝天洗衣店</title>

    <!-- Bootstrap Core CSS -->
    <link href="${bp}/static/admin/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="${bp}/static/admin/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="${bp}/static/admin/dist/css/sb-admin-2.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="${bp}/static/admin/vendor/morrisjs/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="${bp}/static/admin/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<div id="wrapper">

    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.jsp">蓝天洗衣店</a>
        </div>
        <!-- /.navbar-header -->

        <ul class="nav navbar-top-links navbar-right">
            <!-- /.dropdown -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-alerts">

                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-comment fa-fw"></i> 衣服洗好了，正在配送
                                <span class="pull-right text-muted small">4 小时前</span>
                            </div>
                        </a>
                    </li>

                </ul>
                <!-- /.dropdown-alerts -->
            </li>
            <!-- /.dropdown -->
            <!-- 右上角 用户设置入口 -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    ${sessionScope.user.name} <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li><a href="${bp}/adminUser/userinfo"><i class="fa fa-user fa-fw"></i> 用户信息</a>
                    </li>
                    <li><a href="${bp}/vip/index"><i class="fa fa-gear fa-fw"></i> 会员管理</a>
                    </li>
                    <li class="divider"></li>
                    <li><a href="${bp}/adminUser/loginOut"><i class="fa fa-sign-out fa-fw"></i> 退出</a>
                    </li>
                </ul>
                <!-- /.dropdown-user -->
            </li>
            <!-- /.dropdown -->
        </ul>
        <div class="navbar-default sidebar" role="navigation">
            <div class="sidebar-nav navbar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="sidebar-search">
                        <div class="input-group custom-search-form">
                            <input type="text" class="form-control" placeholder="Search...">
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                        </div>
                        <!-- /input-group -->
                    </li>
                    <li>
                        <a href="${bp}/adminUser/adminIndex"><i class="fa fa-dashboard fa-fw"></i> 首页</a>
                    </li>
                    <li>
                        <a href="${bp}/adminOder/index"><i class="fa fa-dashboard fa-fw"></i> 快速订购</a>
                    </li>
                    <li>
                        <a href="${bp}/adminOder/orderRecord"><i class="fa fa-dashboard fa-fw"></i>订购记录</a>
                    </li>
                    <li>
                        <a href="${bp}/vip/index"><i class="fa fa-dashboard fa-fw"></i>会员管理</a>
                    </li>
                </ul>
            </div>
            <!-- /.sidebar-collapse -->
        </div>
        <!-- /.navbar-static-side -->
    </nav>
    <div id="page-wrapper">
        <div class="row">
            <div class="col-md-12">
                <h1 class="page-header">会员管理<span style="font-size:2rem;">当前会员等级：
                                                <c:if test="${(user.leiji > 0)   &&  (user.leiji < 200)}">VIP1</c:if>
                                                <c:if test="${(user.leiji > 100) &&  (user.leiji < 300)}">VIP2</c:if>
                                                <c:if test="${(user.leiji > 300) &&  (user.leiji < 700)}">VIP3</c:if>
                                                <c:if test="${(user.leiji > 700) &&  (user.leiji < 1000)}">VIP4</c:if>

                </span></h1>
            </div>
            <!-- /.col-lg-12 -->
        </div>

        <!-- /.row -->
        <div class="row">
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-star-o fa-5x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div class="huge">VIP1</div>
                                <div>大众会员【优惠9折】</div>
                            </div>
                        </div>
                    </div>
                    <a href="#">
                        <div class="panel-footer">
                            <span class="pull-left">累计消费100元</span>
                            <span class="pull-right">
                                    <i class="fa fa-arrow-circle-right"></i>
                                </span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-green">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-star-o fa-5x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div class="huge">VIP2</div>
                                <div>黄金会员【优惠8折】</div>
                            </div>
                        </div>
                    </div>
                    <a href="#">
                        <div class="panel-footer">
                            <span class="pull-left">累计消费300元</span>
                            <span class="pull-right">
                                    <i class="fa fa-arrow-circle-right"></i>
                                </span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-yellow">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-star fa-5x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div class="huge">VIP3</div>
                                <div>铂金会员【优惠7折】</div>
                            </div>
                        </div>
                    </div>
                    <a href="#">
                        <div class="panel-footer">
                            <span class="pull-left">累计消费700元</span>
                            <span class="pull-right">
                                    <i class="fa fa-arrow-circle-right"></i>
                                </span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
            <div class="col-lg-3 col-md-6">
                <div class="panel panel-red">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-star-o fa-5x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <div class="huge">VIP4</div>
                                <div>钻石会员【优惠6折】</div>
                            </div>
                        </div>
                    </div>
                    <a href="#">
                        <div class="panel-footer">
                            <span class="pull-left">累计消费1000元</span>
                            <span class="pull-right">
                                    <i class="fa fa-arrow-circle-right"></i>
                                </span>
                            <div class="clearfix"></div>
                        </div>
                    </a>
                </div>
            </div>
        </div>
        <!-- 余额 -->
        <div class="row">
            <div class="col-md-6">
                <h1>会员卡余额：<span>${user.mony}元</span></h1><button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target="#rechange">
                充值
            </button>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                    <!-- Modal -->
                    <div class="modal fade" id="rechange" tabindex="-1" role="dialog" aria-labelledby="">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                    <h4 class="modal-title" id=""><h1>会员卡充值</h1></h4>
                                </div>
                                <div class="modal-body">
                                    <input id="userId" type="hidden" value="${user.id}">
                                   <input id="chognzhi" type="text" value="" placeholder="请输入充值金额">
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <button type="button" onclick="add()" class="btn btn-success">充值</button>
                                </div>
                            </div>
                        </div>
                    </div>
            </div>
        </div>
    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

<!-- jQuery -->
<script src="${bp}/static/assets/js/jquery-3.2.1.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="${bp}/static/admin/vendor/bootstrap/js/bootstrap.min.js"></script>

<!-- Metis Menu Plugin JavaScript -->
<script src="${bp}/static/admin/vendor/metisMenu/metisMenu.min.js"></script>

<!-- Morris Charts JavaScript -->
<script src="${bp}/static/admin/vendor/raphael/raphael.min.js"></script>
<script src="${bp}/static/admin/vendor/morrisjs/morris.min.js"></script>
<script src="${bp}/static/admin/data/morris-data.js"></script>

<!-- Custom Theme JavaScript -->
<script src="${bp}/static/admin/dist/js/sb-admin-2.js"></script>

</body>
<script type="text/javascript">
    
    function add() {
        var chongzhi = $("#chognzhi").val();
        var userId = $("#userId").val();
        $.ajax({
            type:"GET",
            url:"${bp}/vip/chongzhi",
            data:{"id":userId,"nmeber":chongzhi},
            success : function (msg) {
                if(msg == 1){
                    alert("充值成功")
                    window.location.reload()
                }
                if(msg == 2){
                    alert("充值失败")
                    window.location.reload()
                }
            }
        })
    }
</script>
</html>